package com.nacrtstudio.webgiftshop.model.shop.beans;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import com.nacrtstudio.webgiftshop.core.beans.BaseBean;
import com.nacrtstudio.webgiftshop.model.shop.Cart;
import com.nacrtstudio.webgiftshop.model.shop.Order;
import com.nacrtstudio.webgiftshop.model.shop.PackedGift;
import com.nacrtstudio.webgiftshop.model.shop.User;
import com.nacrtstudio.webgiftshop.util.shop.OrderStatus;

@Entity
public class OrderBean extends BaseBean implements Order{
	private Long orderId;
	private Date date = new Date();
	private User user;
	private Set<PackedGift> packedGifts;
	private Double totalPrice;
	private OrderStatus orderStatus; 
	
	public Long getOrderId() {
		return orderId;
	}
	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	@ManyToOne(targetEntity=UserBean.class)
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@OneToMany(targetEntity=PackedGiftBean.class)
	@LazyCollection(LazyCollectionOption.FALSE)
	public Set<PackedGift> getPackedGifts() {
		return packedGifts;
	}
	public void setPackedGifts(Set<PackedGift> packedGifts) {
		this.packedGifts = packedGifts;
	}
	
	
	
	
	public Double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}
	
	public OrderStatus getOrderStatus() {
		return orderStatus;
	}
	public void setOrderStatus(OrderStatus orderStatus) {
		this.orderStatus = orderStatus;
	}
}
